import { ITokenModel } from '@delon/auth';

export class Token implements ITokenModel {
    token: string;
    access_token: string;
    refresh_token: string;
    token_type: string;
    expires_in: number;
    scope: string;
    jti: string;
}

export class UserRequest {
    username: string;
    password: string;
    phone: string;
    code: string;
}

export class User {
    id: number;
    username: string;
    enable: boolean;
    avatarUrl: string;
    name: string;
    phone: string;
    email: string;
    gender: string;
    organization: Organization;
    roles: Role[];
}

export class Organization {
    id: number;
    code: string;
    name: string;
    cls: string;
    type: number;
    isParent: boolean;
    parent: Organization;
    children: Organization[];
}

export class Role {
    id: number;
    code: string;
    name: string;
    describes: string;
    users: User[];
    permissions: Permission[];
}

export class Permission {
    id: number;
    url: string;
    name: string;
    describes: string;
}

export class Page {
    first: boolean;
    last: boolean;
    number: number;
    numberOfElements: number;
    size: number;
    sort: any;
    totalElements: number;
    totalPages: number;
    content: any[];
}



export class ResultBean<T> {
    code: string;
    msg: string;
    data: T;
}


export class Product {
    id: number;
    name: string;
    type: number;
    description: string;
    image: string;
}

export class Device {
    id: number;
    name: string;
    username: string;
    password: string;
    image: string;
    product: Product;
    description: string;
    uses: number;
    isOn: boolean;
}

export class  DeviceStatus {
    clientid: string;
    deviceId: number;
    uses: number;
    isOn: boolean;
}
